<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCourseSectionVideosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //章节视频
        Schema::create('course_section_videos', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('course_id')->comment("课程id");
            $table->unsignedInteger('course_section_id')->comment("课程章节id");
            $table->string('name')->comment("名称");
            $table->tinyInteger("cloud")->default(1)->comment("是否云点播[否,是]");
            $table->string('cover_url')->comment("封面")->nullable();
            $table->string('media_url')->comment("视频");
            $table->string('file_id')->comment("云点播文件id")->nullable();
            $table->text('body')->comment("内容")->nullable();

            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('course_section_videos');
    }
}
